class Animal:
    def __init__(self, name):
        self.name = name


    def eat(self):
        print(f'{self.name}吃——')


    def drink(self):
        print(f'{self.name}喝——')

    def run(self):
        print(f'{self.name}跑——')

    def sleep(self):
        print(f'{self.name}睡——')

class Dog(Animal):
    def __init__(self, name,color):
        super().__init__(name)  # 用父亲的初始化
        self.color = color
    def bark(self):
        print(f'{self.color}{self.name}汪汪叫')


class XiaoTianQuan(Dog):
    def __init__(self, name,color,age):
        super().__init__(name,color)
        self.age = age
    def fly(self):
        print(f'{self.name}飞天')

    def sleep(self):
        print(f'{self.color}{self.age}岁的{self.name}装逼的睡——')

if __name__ == '__main__':
    wangcai = Dog('旺财','黄色')
    wangcai.bark()
    wangcai.sleep()
    xiaotianquan=XiaoTianQuan('哮天犬','黑色',20)
    xiaotianquan.fly()
    xiaotianquan.sleep()